package com.mzy.xmyx.sys.controller;


import com.mzy.xmyx.common.result.Result;
import com.mzy.xmyx.model.sys.Ware;
import com.mzy.xmyx.sys.service.WareService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import sun.security.krb5.internal.TGSRep;

import java.util.List;

/**
 * <p>
 * 仓库表 前端控制器
 * </p>
 *
 * @author mzy
 * @since 2023-11-29
 */
@Api(tags = "仓库管理")
@RestController
@RequestMapping("/admin/sys/ware")
@CrossOrigin
public class WareController {

    @Autowired
    private WareService wareService;

    @ApiOperation("查询所有仓库列表")
    @GetMapping("/findAllList")
    public Result findAllList() {
        List<Ware> wareList = wareService.list();
        return Result.ok(wareList);
    }

    @ApiOperation("添加仓库")
    @PostMapping("/save")
    public Result save(@RequestBody Ware ware) {
        Boolean isSuccess = wareService.save(ware);
        return Result.ok(isSuccess);
    }
}

